//
//  ChooseViewCell.m
//  庐山通
//
//  Created by zcj on 15-10-27.
//  Copyright (c) 2015年 郑朝军. All rights reserved.
//

#import "ChooseViewCell.h"
#import "ChooseModel.h"
#import "ChooseModelFrame.h"
#import "GoodsMainImageModel.h"
#import "UIImageView+WebCache.h"

@interface ChooseViewCell()
@property (nonatomic,weak)UIImageView * allImageView;
@end
@implementation ChooseViewCell
+(instancetype)ChooseViewCell:(UITableView *)tableView
{
    static NSString * ID = @"choosecell";
    ChooseViewCell * cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[ChooseViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
    }
    return cell;
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        UIImageView * allImageView = [[UIImageView alloc]init];
        //allImageView.contentMode = UIViewContentModeCenter;
        [self addSubview:allImageView];
        self.allImageView = allImageView;
        // Initialization code
    }
    return self;
}
- (void)setChooseModelFrame:(ChooseModelFrame *)chooseModelFrame
{
    _chooseModelFrame = chooseModelFrame;
    NSString * ImageUrl = chooseModelFrame.chooseModel.main_image.image_original;
    [self.allImageView setImageWithURL:[NSURL URLWithString:ImageUrl] placeholderImage:[UIImage imageNamed:@"tops_jin"]];
    
    self.allImageView.frame = chooseModelFrame.imgAllH;
    
    
}

- (void)awakeFromNib
{
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
